<template>
  <div class="search_content">
    <div class="search_content_box">
      <el-input :placeholder="placeholder" prefix-icon="el-icon-search" v-model="searchInput" class="inputClass" @keyup.enter.native="inputEnter"> </el-input>
      <el-divider direction="vertical"></el-divider>
      <!-- -->
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "search-input",
  props: {
    placeholder: {
      type: String,
      default: "搜索文件、文件夹",
    },
  },
  components: {},
  data() {
    return {
      searchInput: "",
    };
  },
  mounted() {},
  methods: {
    /**输入框回车事件 */
    inputEnter() {
      this.$emit("inputEnter", this.searchInput);
    },
  },
};
</script>
<style scoped lang="scss">
.search_content {
  .search_content_box {
    display: flex;
    align-items: center;
    height: 48px;
    padding-right: 20px;
    margin-left: 20px;
    border-bottom: 1px solid #eee;
    .inputClass {
      width: 220px;
      :deep(.el-input__inner)  {
        border: 0;
      }
    }

    .el-divider--vertical {
      margin: 0 10px;
    }
  }
}
</style>
